<template>
    <div class="web">
        <div class="webLeft">
            <menuleft :menuList="menuList" @handleMenu="handleMenu" :menuFlag="menuFlag" />
        </div>
        <!-- 右侧表格 -->
        <div class="webRight">
            <mytask v-if="menuFlag == '43'"></mytask>
            <branchtask v-if="menuFlag == '44'"></branchtask>
            <!-- <statistics v-if="menuFlag == '45'"></statistics> -->
            <recyclebin v-if="menuFlag == '46'"></recyclebin>
        </div>
    </div>
</template>
<script>
import menuleft from "@/components/menuItem/menuleft.vue";
import mytask from "./myTask.vue";//我的任务
import branchtask from "./branchTask.vue";//下属任务
import recyclebin from "./recyclebin.vue";//回收站
// import statistics from "./statisticsTask.vue"
import { getUserAuthResourceList } from "@/service/Api.js"; //接口
export default {
    name: "taskMent",
    components: {
        menuleft,
        mytask,
        recyclebin,
        branchtask,
        // statistics
    },
    data() {
        return {
            menuList: [
                {
                    name: "任务管理",
                    id: 41,
                    children: []
                }
            ],
            menuFlag: "",
        }
    },
    created() {
        this.getUserOnelist();
    },
    methods: {
        // 获取当前角色下的二级列表
        getUserOnelist() {
            let menuId = parseInt(this.menuList[0].id)
            getUserAuthResourceList(menuId).then((res) => {
                if (res.code == 0) {
                    this.menuList[0].children = res.data;
                    this.menuFlag = res.data[0].id.toString();
                }
            });
        },

        handleMenu(id, index) {
            this.menuFlag = id
        }
    },
}
</script>
<style scoped>
#menu {
    position: fixed;
}

.webLeft>>>.el-submenu.is-active .el-submenu__title {
    border-right: 1px solid #eee !important;
}

.redDots {
    height: 7px;
    width: 7px;
    background: red;
    border-radius: 50%;
    position: absolute;
    top: 72px;
    left: 178px;
    z-index: 999;
}
</style>